package domain
import traits.TLeveleable
import traits.TNameable
import traits.TNameableWithLevel
import traits.elements.TElectric

class Pokemon (val name :String, var hitPoints :Double, var strenght :Int, initialExp :Int = 0) extends TNameableWithLevel {

  this.gainExp(initialExp)
  
 
  def attackPower :Int = {
    this.strenght * this.level
  }
  def damage (power :Double){
	  this.hitPoints = this.hitPoints - power
  }

  def attacked (atack :(Pokemon => Unit), attacker :Pokemon) :Unit = {
	  var bef = this.hitPoints
	  atack(this)
	  
	  var after = this.hitPoints
	   
	  println (attacker.getName + " le pego " + (bef-after) + " de danio a " + this.getName)
  }
  
  def electricWeakness :Double = 1
  def waterWeakness :Double = 1
  def fireWeakness :Double = 1
}